﻿using System.Collections.Generic;
using Pay.DTO;
using Pay.TO;

namespace Pay.IService {
	public interface ITransferService {
		/// <summary>
		/// 查询提现
		/// </summary>
		/// <param name="transferQuery"></param>
		/// <returns></returns>
		PagedResult<transfer_dto> Get(TransferQuery transferQuery);
		/// <summary>
		/// 提现金额，截止昨天
		/// </summary>
		decimal TransferAmount(PayChannel channel);
		/// <summary>
		/// 通过id查询提现
		/// </summary>
		/// <param name="transfer_id"></param>
		/// <returns></returns>
		transfer_dto Get(long transfer_id);
		/// <summary>
		/// 通过单号查询提现
		/// </summary>
		/// <param name="order_no"></param>
		/// <returns></returns>
		transfer_dto Get(string merchant_no, string order_no);
		transfer_dto GetByPayNo(string merchant_no, string pay_no);
		/// <summary>
		/// 通过流水号查询提现
		/// </summary>
		/// <param name="transactionNo"></param>
		/// <returns></returns>
		transfer_dto GetByTran(string transactionNo);
		PagedResult<transfer_batch_dto> Get(TransferBatchQuery transferQuery);
		/// <summary>
		/// 申请提现
		/// </summary>
		/// <param name="dto"></param>
		/// <returns></returns>
		int ApplyTransfer(apply_transfer dto);
        /// <summary>
        /// 提现成功
        /// </summary>
        /// <returns>The success.</returns>
        /// <param name="dto">Dto.</param>
        int TransferSuccess(platform_transfer dto);
		/// <summary>
		/// 提现失败
		/// </summary>
		/// <returns>The fail or un confirm.</returns>
		/// <param name="dto">Dto.</param>
		int TransferFail(platform_transfer dto);
		/// <summary>
		/// 重新生成代付和收款信息
		/// </summary>
		/// <returns>The suceess.</returns>
		/// <param name="dto">Dto.</param>
		int ReTransfer(re_transfer dto);
		/// <summary>
		/// 取消
		/// </summary>
		/// <returns>The cancel.</returns>
		/// <param name="id">Identifier.</param>
		int Cancel(long id);
		transfer_batch_dto GetBatch(long batch_id);
		transfer_batch_dto GetBatch(string batch_no);
		/// <summary>
		/// 批处理申请提现
		/// </summary>
		/// <returns>The transfer.</returns>
		/// <param name="batch_model">Batch model.</param>
		long ApplyTransfer(batch_transfer batch_model);
		/// <summary>
		/// 更新批处理状态
		/// </summary>
		/// <param name="batch_id">Batch identifier.</param>
		/// <param name="noticeTranId">报盘流水号</param>
		/// <param name="status">Status.</param>
		int UpdateBatch(long batch_id, string noticeTranId, TransferBatchStatus status);

		/// <summary>
		/// 批处理回盘，修改状态
		/// </summary>
		/// <param name="dto"></param>
		/// <returns></returns>
		int Transfer(List<platform_transfer> dto, long batch_id, TransferBatchStatus status, string backFile);
	}
}